package com.itxckf.mapper;

import com.itxckf.pojo.Comments;
import com.itxckf.pojo.Products;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper

public interface ProductsMapper {

    List<Products> getProductsList(@Param("name") String name);
    List<Products> getProductsListMini(@Param("name") String name);

    void addProducts(Products products);


    @Delete("DELETE FROM Products WHERE ProductID = #{id};")
    void deleteProducts(Short id);

    void updateProducts(Products products);

    @Select("SELECT * FROM Comments WHERE ProductID = #{id};")
    List<Comments> getProductsComment(Short id);

    void addProductsComment(Comments comments);
}
